<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <script src="/layui/layui.js"></script>
    <script src="/js/jquery/jquery-3.5.1.js"></script>
    <script src="/js/book/book.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/bookList.css">
    <title>内容</title>
</head>
<body>

<div class="page-style">

    <div class="content_read">
        <div class="table-css" id="read_content">
        </div>
    </div>
    <div class="footer">
        <div class="footer_cont"></div>
        <p>所有小说由蜘蛛程序自动抓取自网络公开资源，本站严格准守国家法律法规，拒绝任何色情、政治小说，一经发现，即作删除。</p>
    </div>
</div>

<script th:inline="javascript">
    var  titleName="";
    var  chapertInfo="";
    var param  = [[${data}]];
    $.ajax({
        type:"post",
        url:'/bookMagic/readMagicBook',
        data:param,
        dataType:"json",
        async:false,
        contentType : "application/json; charset=utf-8",
        success: function(res){
            console.log(res)
            chapertInfo=res;
            //上下章目录按钮
            var udm = "<div class='udm'>" +
                "<a class='bottom-button' id='up'>上一章</a>" +" ← "+
                "<a class='bottom-button' id='menu'>返回章节</a>" +" → "+
                "<a class='bottom-button' id='next'>下一章</a>" +
                "</div>"
            //上下章目录按钮
            var udm2 = "<div class='udm2'>" +
                "<a class='bottom-button' id='up' >上一章</a>" +" ← "+
                "<a class='bottom-button' id='menu' >返回章节</a>" +" → "+
                "<a class='bottom-button' id='next' >下一章</a>" +
                "</div>"
            var data = res;
            titleName=data.chapterName;
            var titleText = data.chapterContext;
            document.title = titleName;
            var bookName = "<div class='book_name'>" +
                 "<h1>"+titleName+"</h1>" +udm+
                "</div>"
            var content = "<div class='content'>"+titleText+udm2+"</div>"

            $("#read_content").append(bookName);
            $("#read_content").append(content);
        }
    })
</script>

</body>
</html>